package com.bawei.lib_net.msgbus

object LiveDataBus {
    private val mBus = hashMapOf<String, SingleLiveData<Any>>()

    fun <T>with(channel: String): SingleLiveData<T> {
        if (!mBus.containsKey(channel)) {
            mBus[channel] = SingleLiveData()
        }
        return mBus[channel]!! as SingleLiveData<T>
    }
}